import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '任务名',
    align: "center",
    sorter: true,
    dataIndex: 'taskName'
  },
  {
    title: '需求条目',
    align: "center",
    sorter: true,
    dataIndex: 'reqItem'
  },
  // {
  //   title: '业务流程',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'businessFlow',
  //   customRender: render.renderImage,
  // },
  {
    title: '业务详情描述',
    align: "center",
    sorter: true,
    dataIndex: 'businessDetails',
  },
  // {
  //   title: '业务规则',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'businessRule',
  // },
  // {
  //   title: '输入输出',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'businessInOut',
  // },
  // {
  //   title: '原型页面',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'prototypePage',
  //   customRender: render.renderImage,
  // },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "任务名",
    field: 'taskName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "需求条目",
    field: 'reqItem',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "业务流程",
    field: 'businessFlow',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "业务详情描述",
    field: 'businessDetails',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "业务规则",
    field: 'businessRule',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "输入输出",
    field: 'businessInOut',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "原型页面",
    field: 'prototypePage',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务名',
    field: 'taskName',
    component: 'Input',
  },
  {
    label: '需求条目',
    field: 'reqItem',
    component: 'Input',
  },
  {
    label: '业务流程',
    field: 'businessFlow',
    component: 'JImageUpload',
    componentProps:{
    },
  },
  {
    label: '业务详情描述',
    field: 'businessDetails',
    component: 'JEditor',
  },
  {
    label: '业务规则',
    field: 'businessRule',
    component: 'JEditor',
  },
  {
    label: '输入输出',
    field: 'businessInOut',
    component: 'JEditor',
  },
  {
    label: '原型页面',
    field: 'prototypePage',
    component: 'JImageUpload',
    componentProps:{
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  taskName: {title: '任务名',order: 0,view: 'text', type: 'string',},
  reqItem: {title: '需求条目',order: 1,view: 'text', type: 'string',},
  businessFlow: {title: '业务流程',order: 2,view: 'image', type: 'string',},
  businessDetails: {title: '业务详情描述',order: 3,view: 'umeditor', type: 'string',},
  businessRule: {title: '业务规则',order: 4,view: 'umeditor', type: 'string',},
  businessInOut: {title: '输入输出',order: 5,view: 'umeditor', type: 'string',},
  prototypePage: {title: '原型页面',order: 6,view: 'image', type: 'string',},
};
